<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        var shuzu=[5,4,3,2,1];
         var gege=0;
        for(var i=0;i<shuzu.length-1;i++)
        { 
            for(var k=i+1;k<shuzu.length;k++){
                if(shuzu[k]<shuzu[i]){
                    gege=shuzu[i];
                    shuzu[i]=shuzu[k];
                    shuzu[k]=gege;
                }
            }
        }
        console.log("数组从小到大排序"+shuzu);
    </script> 
    
</head>
<body>
    <p align="center"> &copy; 版权由xx归属，未经允许不得复埭、镜像</p>
</body>
</html>